/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package stream;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

/**
 *
 * @author Educacionit
 */
public class Escritor {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        File archOut = new File("salida.txt");
        FileWriter out = null;
        BufferedWriter bout = null;
        try {
            out = new FileWriter(archOut);
            bout = new BufferedWriter(out);
            String info = "Uno es lo que hace "
                        + "y no lo que dice ser.";
            for (int i = 0; i < info.length(); i++) {
                bout.write(info.charAt(i));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally{
            try {bout.close();}
            catch(Exception e){
                e.printStackTrace();
            }
            try {out.close();}
            catch(Exception e){
                e.printStackTrace();
            }
        }
    }

}
